package com.anjubao.parking.municipal.payment.form;

import com.anjubao.parking.municipal.common.exception.ServiceException;
import com.anjubao.parking.municipal.payment.constant.PayChannelIdEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

/**
 * 提交停车订单参数
 *
 * @author zhuchunfeng
 */
@Getter
@Setter
@ApiModel(value="BalanceRechargeForm",description = "余额充值表单提交")
public class BalanceRechargeForm {

    @ApiModelProperty(value = "用户16为id",required = true)
    private String userCode;

    @ApiModelProperty(value = "支付金额",required = true)
    private Integer totalFee;

    @ApiModelProperty(value = "子系统业务id",required = true)
    private String businessId;

    public void validate(){
        if (null == totalFee || totalFee == 0) {
            throw new ServiceException("totalFee不能为空  totalFee不能0");
        }
        if (StringUtils.isEmpty(businessId)) {
            throw new ServiceException("业务id不能为空");
        }

    }

}